#region Code by Robert McLaws

//Original code by Telligent
//Last Updated: Robert McLaws
//Date: 22 Sept 2007

#endregion

#region Import Declarations

using System;
using System.Collections.Generic;
using System.Text;
using CommunityServer.Controls;
using CommunityServer.Components;
using System.Web.UI;
using System.Web.UI.WebControls;

#endregion

namespace CommunityServerStuff.Controls
{
    /// <summary>
    /// IButton implementation of Button
    /// </summary>
    public class CSImageButton : ImageButton, IButton
    {

        private static readonly object EventButtonClick = new object();
        private static readonly object EventClick = new object();
        private static readonly object EventCommand = new object();


        #region IButton Members

        event System.EventHandler IButton.Click
        {
            add { base.Events.AddHandler(EventClick, value); }
            remove { base.Events.RemoveHandler(EventClick, value); }
        }

        event CommandEventHandler IButton.Command
        {
            add { this.Command += value; }
            remove { this.Command -= value; }
        }

        event System.Web.UI.ImageClickEventHandler Click
        {
            add { this.Click += value; }
            remove { this.Click -= value; }
        }
        
        #endregion

        #region IText Members
        public Control Control
        {
            get { return this; }
        }

        #endregion


        #region ITextControl Members

        public new string Text
        {
            get { return base.Text; }
            set{ base.Text = value; }
        }

        #endregion
    }
}
